import request from '@/utils/request'

const api = {
  // 获取物料分组带物料数量
  GetAllGoodsGroupData(data, method) {
    return request({
      url: '/api/GoodsGroup/GetAllGoodsGroupData',
      method: method || 'post',
      data: data
    })
  },

  // 新增物料分组
  AddGoodsGroup(data, method) {
    return request({
      url: '/api/GoodsGroup/AddGoodsGroup',
      method: method || 'post',
      data: data
    })
  },
  // 修改物料分组
  UpdateGoodsGroup(data, method) {
    return request({
      url: '/api/GoodsGroup/UpdateGoodsGroup',
      method: method || 'post',
      data: data
    })
  },
  // 删除物料分组
  DeleteGoodsGroup(data, method) {
    return request({
      url: '/api/GoodsGroup/DeleteGoodsGroup',
      method: method || 'post',
      data: data
    })
  },

  // 新增物料
  getAddGoods(data, method) {
    return request({
      url: '/api/Goods/AddGoods',
      method: method || 'post',
      data: data
    })
  },
  // 删除物料
  DeleteGoods(data, method) {
    return request({
      url: '/api/Goods/DeleteGoods',
      method: method || 'post',
      data: data
    })
  },
  // 物料-物料详情
  GetSingleGoods(data, method) {
    return request({
      url: '/api/Goods/GetGoodsSpecificationViewDetail',
      method: method || 'post',
      data: data
    })
  },
  // 物料-更新物料
  UpdateGoods(data, method) {
    return request({
      url: '/api/Goods/UpdateGoods',
      method: method || 'post',
      data: data
    })
  },
  // 物料-物料修改的时候，删除规格型号
  DeleteStockGoods(data, method) {
    return request({
      url: '/api/Goods/DeleteStockGoods',
      method: method || 'post',
      data: data
    })
  },
  // 所有物料列表数据
  GetMatchPageGoods(data, method) {
    return request({
      url: '/api/Goods/GetPageGoodsSpecificationView',
      method: method || 'post',
      data: data
    })
  },
  // 供应商列表
  GetAllSuppliers(data, method) {
    return request({
      url: '/api/Supplier/GetAllSuppliers',
      method: method || 'post',
      data: data
    })
  },
  // 物料单位列表
  GetAllGoodsUnits(data, method) {
    return request({
      url: '/api/Business/GetDictionaryByCode',
      method: method || 'post',
      params: data
    })
  },
  // 物料类型列表
  GetAllGoodsCategorys(data, method) {
    return request({
      url: '/api/GoodsCategory/GetAllGoodsCategorys',
      method: method || 'post',
      data: data
    })
  },
  // 物料-禁用/启用物料
  SetGoodsState(data, method) {
    return request({
      url: '/api/Goods/DisableGoods',
      method: method || 'post',
      params: data
    })
  },
  // 物料-采购物料选择列表
  GetMatchStockGoodss(data, method) {
    return request({
      url: '/api/Goods/GetMatchGoods',
      method: method || 'post',
      data: data
    })
  },

  // 修改物料规格状态
  UpdateGoodsSpecificationState(data, method) {
    return request({
      url: '/api/Goods/UpdateGoodsSpecificationState',
      method: method || 'post',
      data: data
    })
  },

  //物料规格-物料规格新增
  AddSpecification(data, method) {
    return request({
      url: '/api/GoodsSpecification/AddSpecification',
      method: method || 'post',
      data: data
    })
  },

  //根据供应商获取物料和物料规格数据
  GetGoodsSpecificationBySupplierCode(data, method) {
    return request({
      url: '/api/GoodsSpecification/GetGoodsSpecificationBySupplierCode',
      method: method || 'post',
      data: data
    })
  }

}

export default api
